package com.demo.gateway.mapping;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jayway.jsonpath.JsonPath;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: yzy
 * @desc:
 * @date: 2024/7/16 11:48
 **/
public class JsonMapper {
    static String targetJson = "{ \"store\": {\n" +
            "    \"book\": [ \n" +
            "      { \"category\": \"reference\",\n" +
            "        \"author\": \"Nigel Rees\",\n" +
            "        \"title\": \"Sayings of the Century\",\n" +
            "        \"price\": 8.95\n" +
            "      },\n" +
            "      { \"category\": \"fiction\",\n" +
            "        \"author\": \"Evelyn Waugh\",\n" +
            "        \"title\": \"Sword of Honour\",\n" +
            "        \"price\": 12.99\n" +
            "      },\n" +
            "      { \"category\": \"fiction\",\n" +
            "        \"author\": \"Herman Melville\",\n" +
            "        \"title\": \"Moby Dick\",\n" +
            "        \"isbn\": \"0-553-21311-3\",\n" +
            "        \"price\": 8.99\n" +
            "      },\n" +
            "      { \"category\": \"fiction\",\n" +
            "        \"author\": \"J. R. R. Tolkien\",\n" +
            "        \"title\": \"The Lord of the Rings\",\n" +
            "        \"isbn\": \"0-395-19395-8\",\n" +
            "        \"price\": 22.99\n" +
            "      }\n" +
            "    ],\n" +
            "    \"bicycle\": {\n" +
            "      \"color\": \"red\",\n" +
            "      \"price\": 19.95\n" +
            "    }\n" +
            "  }\n" +
            "}";

    static String mapping = "{ \"mpstore\": {\n" +
            "    \"mpbook\": [ \n" +
            "      { \"mpcategory\": \"${STR::store.book.category}\",\n" +
            "        \"mpauthor\": \"${STR::stroe.book.author}\",\n" +
            "        \"mptitle\": \"${STR::store.book.title}\",\n" +
            "        \"mpprice\": \"${NUM::store.book.price}\"\n" +
            "      }\n" +
            "    ],\n" +
            "    \"mpbicycle\": {\n" +
            "      \"mpcolor\": \"${STR::store.bicycle.color}\",\n" +
            "      \"mpprice\": \"${CNF::store.bicycle.price}\"\n" +
            "    }\n" +
            "  }\n" +
            "}";

}
